<template>
	<globalModal
		:title="title"
		:visible="visible"
		:confirmLoading="confirmLoading"
		@ok="handleOk"
		@cancel="handleCancel"
	>
		<a-spin :spinning="confirmLoading">
			<a-form :form="form" autocomplete="off" :labelCol="labelCol" :wrapperCol="wrapperCol">
				<a-form-item label="产品类型">
					<a-input
						placeholder="产品类型"
						v-decorator="[
							'prodTypeName',
							{
								rules: [
									{ required: true, message: '请输入产品类型' },
									{ max: 30, message: '产品类型不超过30个字符' },
								],
								getValueFromEvent: removeSpaces,
							},
						]"
					/>
				</a-form-item>
				<a-form-item label="产品类型编号">
					<a-input
						placeholder="产品类型编号"
						v-decorator="[
							'prodTypeCode',
							{
								rules: [
									{ required: true, message: '请输入产品类型编号' },
									{ max: 10, message: '产品类型编号不超过10个字符' },
								],
								getValueFromEvent: removeSpaces,
							},
						]"
					/>
				</a-form-item>
			</a-form>
		</a-spin>
	</globalModal>
</template>

<script>
import { ModalMixins } from '@/mixins';
export default {
	name: 'addOrEditProductTypeModal',
	mixins: [ModalMixins],
};
</script>
